package com.lccviolet;

import java.util.Random;

/**
 * @author LiChaochao
 * @Date 2021/9/24 20:14
 * @Description Java heap space
 *
 * -Xms10m -Xmx10m：设置小的堆内存
 */
public class JavaHeapSpaceDemo {
    public static void main(String[] args) {
        // 方法一
        byte[] bytes = new byte[20 * 1024 * 1024];

        // 方法二
        /*String str = "violet";

        while (true) {
            str += str + new Random().nextInt(11111111) + new Random().nextInt(22222222);
            str.intern();
        }*/
    }
}
